<?php

namespace App\imageType;

use Intervention\Image\Image;
use Intervention\Image\Filters\FilterInterface;

class Large implements FilterInterface
{
    public function applyFilter(Image $image)
    {
        $height=$image->height();
        $width=$image->width();
        $scale=$height/$width;
       if($scale>1){
           if($height>560){
               $height=560;
               $width=$height/$scale;
           }

       }else{
           if($width>877){
               $width=877;
               $height=$width*$scale;
           }
       }

        return $image->fit(floor($width),floor($height));
    }
}
